home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / GSCOORD.H < prev    next >
Text File  |  1993-05-16  |  2KB  |  46 lines

  1. /* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gscoord.h */
  20. /* Coordinate system operators for Ghostscript library */
  21. /* Requires gsmatrix.h and gsstate.h */
  22.  
  23. /* Coordinate system modification */
  24. int    gs_initmatrix(P1(gs_state *)),
  25.     gs_defaultmatrix(P2(const gs_state *, gs_matrix *)),
  26.     gs_currentmatrix(P2(const gs_state *, gs_matrix *)),
  27.     gs_currentcharmatrix(P3(gs_state *, gs_matrix *, int)),
  28.     gs_setmatrix(P2(gs_state *, const gs_matrix *)),
  29.     gs_translate(P3(gs_state *, floatp, floatp)),
  30.     gs_scale(P3(gs_state *, floatp, floatp)),
  31.     gs_rotate(P2(gs_state *, floatp)),
  32.     gs_concat(P2(gs_state *, const gs_matrix *));
  33.  
  34. /* Coordinate transformation */
  35. int    gs_transform(P4(gs_state *, floatp, floatp, gs_point *)),
  36.     gs_dtransform(P4(gs_state *, floatp, floatp, gs_point *)),
  37.     gs_itransform(P4(gs_state *, floatp, floatp, gs_point *)),
  38.     gs_idtransform(P4(gs_state *, floatp, floatp, gs_point *));
  39.  
  40. /* Inline versions of some of the transformations */
  41. #define gs_idtransform_inline(pgs, dx, dy, pt)\
  42.   (is_skewed(&(pgs)->ctm) ? gs_idtransform(pgs, dx, dy, pt) :\
  43.    is_fzero((pgs)->ctm.xx) || is_fzero((pgs)->ctm.yy) ?\
  44.      gs_note_error(gs_error_undefinedresult) :\
  45.    ((pt)->x = (dx) / (pgs)->ctm.xx, (pt)->y = (dy) / (pgs)->ctm.yy, 0))
  46.